/**
 * Created with Intellij IDEA.
 * Description:
 * User: wangj
 * Date: 2022-02-19
 * Time: 7:58
 */
public class TestDemo {
    public static double avg(int []arr){
        int count= arr.length;
        int sum=0;
        for (int i = 0; i <count ; i++) {
            sum+=arr[i];
        }
        double ret=(double)sum/(double) count;
        return ret;
    }
    public static int sum(int []arr){
        int sum=0;
        for (int i = 0; i < arr.length; i++) {
            sum+=arr[i];
        }
        return sum;
    }
    public static void printArray(int []arr){
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]+" ");
        }
        System.out.println();
    }
    public static void main(String[] args) {
        int []arr={1,2,3,4,5,6,7,8,9,10};
        printArray(arr);
//        int ret1=sum(arr);
//        System.out.println(ret1);
//        double ret=avg(arr);
//        System.out.println(ret);
    }
}
